<UserControl x:Class="WPFExcelReport.ITXGABBS"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" 
                    xmlns:dat="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
                    xmlns:wep="clr-namespace:WPFExcelReport" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
              HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch" 
                    >
    <UserControl.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>  
        <CollectionViewSource  x:Key="vwGABBS" Source="{Binding Path=SetMaster.ICC_GABBS}"/>
        <CollectionViewSource  x:Key="vwTMPGABBS" Source="{Binding Path=SetDetail.ICC_GABBS}"/>
    </UserControl.Resources> 
    <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition   Height="Auto" />
                        <RowDefinition   Height="*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition  Width="1*" />
                        <ColumnDefinition Width="1*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Row="0" Grid.ColumnSpan="2" Margin="0,0,-0.2,0">
                        <WrapPanel >
                            <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=下载}}" Click="Load_Click"></Button>
                            <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=新建}}" Click="New_Click"></Button>
                            <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=编辑}}" Click="Edit_Click"></Button>
                            <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=复制}}" Click="Copy_Click"></Button>
                            <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=全部复制}}" Click="CopyAll_Click"></Button>
                            <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=保存}}" Click="Save_Click"></Button>
                            <Button Margin="15,0,0,0" Content="{Binding Source={Localization:Translate Word=取消}}" Click="butDiscard_Click"></Button>
                        </WrapPanel> 
                    </StackPanel>

                    <DataGrid  Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwGABBS}}"  
                              HeadersVisibility="Column"                           
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="0,0,0,0" 
                              >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=ROWNID}" Header="{Binding Source={Localization:Translate Word=ROWNID}}"   Width="Auto"  MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=GABBS}" Header="{Binding Source={Localization:Translate Word=关键字}}"   Width="Auto"  MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=EN}" Header="{Binding Source={Localization:Translate Word=英文}}"  Width="Auto" MinWidth="80"/>
                            <DataGridTextColumn Binding="{Binding Path=SCN, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=中文}}"  Width="Auto" MinWidth="80"/>
                        </DataGrid.Columns>
                    </DataGrid>
                    <DataGrid  Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="1"
                              AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwTMPGABBS}}"  
                              HeadersVisibility="Column"                               
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" Margin="0,0,0.6,0" 
                              >
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=ROWNID}" Header="{Binding Source={Localization:Translate Word=ROWNID}}"   Width="Auto"  MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=GABBS}" Header="{Binding Source={Localization:Translate Word=关键字}}"   Width="Auto"  MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=EN}" Header="{Binding Source={Localization:Translate Word=英文}}"  Width="Auto" MinWidth="80"/>
                            <DataGridTextColumn Binding="{Binding Path=SCN, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=中文}}"  Width="Auto" MinWidth="80"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>  
</UserControl>
